egl: Make sure highest possible GL version is created
authorBenjamin Otte <otte@redhat.com>
Tue, 25 Apr 2023 18:08:33 +0000 (20:08 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 27 Apr 2023 00:13:32 +0000 (02:13 +0200)
commit34662fc4b05fa5b43b88a093b5db7a700380387d
treeabcb32cc02a8a4e30dbb70d02a098dc09f404a05
parent5b376cedcff5e6d30e9d1db93563d47d13b19aac
egl: Make sure highest possible GL version is created

The EGL spec states:

    The context returned must be the specified version, or a later
    version which is backwards compatible with that version.
    Even if a later version is returned, the specified version
    must correspond to a defined version of the client API.

GTK has so far been relying on EGL implementations returning a
later version, because that is what Mesa does.
But ANGLE does not do that and only provides the minimum version, which
means Windows EGL has been forced to use a lower EGL version for no
reason.

So fix this and try versions in order from highest to lowest.
gdk/gdkglcontext.c
gdk/gdkglcontextprivate.h
gdk/gdkglversionprivate.h